package com.ruoyi.inspection.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.inspection.domain.FzInspectionPlan;
import com.ruoyi.inspection.mapper.FzInspectionPlanMapper;
import com.ruoyi.inspection.service.IFzInspectionPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 计划Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-03-13
 */
@Service
public class FzInspectionPlanServiceImpl implements IFzInspectionPlanService
{
    @Autowired
    private FzInspectionPlanMapper fzInspectionPlanMapper;

    /**
     * 查询计划
     * 
     * @param planId 计划ID
     * @return 计划
     */
    @Override
    public FzInspectionPlan selectFzInspectionPlanById(String planId)
    {
        return fzInspectionPlanMapper.selectFzInspectionPlanById(planId);
    }

    /**
     * 查询计划列表
     * 
     * @param fzInspectionPlan 计划
     * @return 计划
     */
    @Override
    public List<FzInspectionPlan> selectFzInspectionPlanList(FzInspectionPlan fzInspectionPlan)
    {
        return fzInspectionPlanMapper.selectFzInspectionPlanList(fzInspectionPlan);
    }

    /**
     * 新增计划
     * 
     * @param fzInspectionPlan 计划
     * @return 结果
     */
    @Override
    public int insertFzInspectionPlan(FzInspectionPlan fzInspectionPlan)
    {
        fzInspectionPlan.setCreateTime(DateUtils.getNowDate());
        return fzInspectionPlanMapper.insertFzInspectionPlan(fzInspectionPlan);
    }

    /**
     * 修改计划
     * 
     * @param fzInspectionPlan 计划
     * @return 结果
     */
    @Override
    public int updateFzInspectionPlan(FzInspectionPlan fzInspectionPlan)
    {
        fzInspectionPlan.setUpdateTime(DateUtils.getNowDate());
        return fzInspectionPlanMapper.updateFzInspectionPlan(fzInspectionPlan);
    }

    /**
     * 删除计划对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFzInspectionPlanByIds(String ids)
    {
        return fzInspectionPlanMapper.deleteFzInspectionPlanByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除计划信息
     * 
     * @param planId 计划ID
     * @return 结果
     */
    @Override
    public int deleteFzInspectionPlanById(String planId)
    {
        return fzInspectionPlanMapper.deleteFzInspectionPlanById(planId);
    }
}
